home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 3: Developer Tools / Linux Cubed Series 3 - Developer Tools.iso / devel / lang / ada / adaed-1.11 / adaed-1 / Adaed-1.11.0a / config.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-02-07  |  6.3 KB  |  241 lines

  1. /*
  2.  * Copyright (C) 1985-1992  New York University
  3.  * 
  4.  * This file is part of the Ada/Ed-C system.  See the Ada/Ed README file for
  5.  * warranty (none) and distribution info and also the GNU General Public
  6.  * License for more details.
  7.  
  8.  */
  9. #ifndef _config_h
  10. #define _config_h
  11.  
  12. /* header file with common symbols to be used by all phases of Ada/Ed-C
  13.  *
  14.  * Note that some configuration information needs to be defined when porting
  15.  * to a new machine or operating system.
  16.  *
  17.  * Most importantly the following symbolic constants need to be set for
  18.  * each host
  19.  *
  20.  * WORDSIZE32 or WORDSIZE16 -- whether an "int" is 32 bits or 16 bits
  21.  * BSD or SYSTEM_V          -- for unix systems
  22.  * OP_SYS                   -- string representing info on machine/OS config
  23.  * ALIGN2 or ALIGN4         -- systems which need alignment as explained below
  24.  *
  25.  * ALIGN2 defined if data items other than char must be aligned on at least
  26.  * 2 byte boundaries. (e.g. MC68000).
  27.  * ALIGN4 defined if data items other than char must be aligned on at least
  28.  * 4 byte boundaries. (e.g. SPARC).
  29.  */
  30.  
  31. #ifdef sun
  32. #define WORDSIZE32
  33. #ifndef BSD
  34. #define BSD
  35. #endif
  36. #ifdef mc68000
  37. #define ALIGN2
  38. #define OP_SYS "Sun 3 - Sun OS"
  39. #endif
  40. #ifdef sparc
  41. #define ALIGN4
  42. #define OP_SYS "Sparc - Sun OS"
  43. #endif
  44. #endif
  45.  
  46. #ifdef att3b
  47. #define WORDSIZE32
  48. #define SYSTEM_V
  49. #define ALIGN2
  50. #define OP_SYS "ATT 3B"
  51. #endif
  52.  
  53. #ifdef ALIGN4 
  54. #define ALIGN2
  55. #endif
  56.  
  57. #ifdef ALIGN2
  58. #define ALIGN_WORD
  59. #endif
  60.  
  61. #if (defined BSD) || (defined SYSTEM_V)
  62. #ifndef unix
  63. #define unix
  64. #endif
  65. #endif
  66.  
  67. /* 
  68.  * The following symbolic constants are defined for most implementations
  69.  * and only need to be changed if necessary.
  70.  * 
  71.  * NULLFILENAME -- a name representation a null file
  72.  *
  73.  * Return codes passed between phases:
  74.  *  RC_SUCCESS            everything ok 
  75.  *    RC_ERRORS            errors found, successful termination
  76.  *    RC_INTERNAL_ERROR    internal compiler error
  77.  *    RC_ABORT            e.g. file not found
  78.  *
  79.  * MACHINE_CODE -- defined to turn on capability for generated code trace
  80.  * in the compilation listing 
  81.  *
  82.  * HI_LEVEL_IO -- forces use of the high level i/o package of C rather than
  83.  * the low level i/o package.
  84.  *
  85.  * LIBFILENAME -- the name of the library file. It should be "lib" unless
  86.  * the operating system at hand uses this for another meaning.
  87.  *
  88.  */
  89.  
  90. #define RC_SUCCESS         0
  91. #define RC_ERRORS          1
  92. #define RC_INTERNAL_ERROR  2
  93. #define RC_ABORT           3
  94. #define MACHINE_CODE
  95. #define HI_LEVEL_IO
  96. #define LIBFILENAME "lib"
  97. #define OM NULL
  98.  
  99. #ifdef unix
  100. #define DIR_DELIMITER  "/"
  101. #define NULLFILENAME "/dev/null"
  102. #define SUPPORT_PRAGMA_INTERFACE
  103. #endif
  104.  
  105. #ifdef vms
  106. #define WORDSIZE32
  107. #undef RC_SUCCESS
  108. #undef RC_ERRORS
  109. #undef RC_INTERNAL_ERROR
  110. #undef RC_ABORT
  111. #define RC_SUCCESS          241
  112. #define RC_ERRORS           245
  113. #define RC_INTERNAL_ERROR   249
  114. #define RC_ABORT            253
  115. #define DIR_DELIMITER .
  116. #define OP_SYS "VAX/VMS 5.0"
  117. #define NULLFILENAME "nl:"
  118. /* use low level io since at time the high level io didn't work on VMS */
  119. #undef  HI_LEVEL_IO
  120. #define LO_LEVEL_IO
  121. #undef LIBFILENAME
  122. /* Some vms sites running eunice use lib  to corresond to unix lib  */
  123. #define LIBFILENAME "adalib"
  124. #endif
  125.  
  126. #ifdef IBM_PC
  127. #define WORDSIZE32
  128. #define OP_SYS "(MS/DOS 3.0)"
  129. #define NULLFILENAME "NUL"
  130. #define DIR_DELIMITER  "\\"
  131. /* pass error message strings by phrase number */
  132. #define ERRNUM
  133. /* for some reason, the PC doesn't like the name str_errmsgn, so rename */
  134. #define str_errmsgn s_ermsgn
  135. #define PREDEF_PC
  136. /* define DEBUG_INT to enable -i i instruction trace */
  137. /* enable on PC until certified except for EXPORT version */
  138. #ifndef EXPORT
  139. #define DEBUG_INT
  140. #endif
  141. /* define IO_EOF to avoid bug in Metaware library when try to read
  142.  * past end of file; problem is that when call fgetc after EOF seen
  143.  * Metaware library goes into loop. (shields 7-8-86)
  144.  */
  145. #define IO_EOF
  146. #endif
  147.  
  148. #ifdef WORDSIZE32
  149. #define DIGS    4
  150. #define BAS    10000
  151. #define MAX_INTEGER 2147483647
  152. #define MIN_INTEGER -2147483648
  153. #define ADA_MANTISSA_SIZE    24
  154. /* BITS_SU gives the number of bits in a storage unit. */
  155. #define BITS_SU 32
  156. #endif
  157.  
  158. #ifdef WORDSIZE16
  159. #define DIGS    2
  160. #define BAS    100
  161. #define MAX_INTEGER    32767
  162. #define MIN_INTEGER    -32768
  163. /* Define MAX_INTEGER_LONG if C ints and longs have different sizes. */
  164. #define MAX_INTEGER_LONG 2147483647
  165. #define MAX_INTEGER_LONG_STRING "2147483647"
  166. #define ADA_MANTISSA_SIZE    24
  167. /* BITS_SU gives the number of bits in a storage unit. */
  168. #define BITS_SU 16
  169. #endif
  170.  
  171. #define TRUE 1
  172. #define FALSE 0
  173.  
  174. /* Error codes written by various phases to MSGFILE */
  175. /* Note: None of these should be defined to be 0 */
  176.  
  177. #define PRAGMA_LIST_ON 1
  178. #define PRAGMA_LIST_OFF 2
  179. #define PRAGMA_LIST_ERR 3
  180. #define PRAGMA_PAGE 4
  181.  
  182. #define ERR_LEXICAL 10
  183. #define ERR_SYNTAX 11
  184. #define ERR_SEMANTIC 12
  185. #define ERR_WARNING 13
  186. #define INFORMATION 14
  187. #define ERR_BIND    15
  188. #define ERR_COMPILER 16
  189.  
  190. /* Limits for interpreter */
  191.  
  192. #define MAX_PRIO        5  /* max priority value, prio = 0..5 */
  193. #define MAX_TASKS     128  /* max number of tasks */
  194. #define MAX_CUNITS     64  /* max number of compilation units */
  195. #define MAX_BODIES    256  /* max subprgs+task bodies+spec/body not in cunit */
  196. #define MAX_ALTS       64  /* maximum open alternatives */
  197. #define MAX_DISCR      64  /* maximum number of discriminants in record */
  198. #define MAX_IDLEN     256  /* maximum identifier length */
  199. #define MAX_LINE_LEN  256  /* maximum line length */
  200.  
  201. #ifdef IBM_PC
  202. #define MAX_MEM    32000  /* maximum words per heap */
  203. #else
  204. #define MAX_MEM    128000 /* maximum words in heap */
  205. #endif
  206.  
  207. /* version numbers for library files */
  208. #define AIS_VERSION '1'
  209. #define AST_VERSION '1'
  210. #define LIB_VERSION '1'
  211. #define STUB_VERSION '1'
  212. #define TRE_VERSION '1'
  213.  
  214. /*  The following is a variable used for deciding whether to optimize
  215.  *  an array aggregate.  If specifies the maximum size of a segment
  216.  *  to be created on the data stack.  If an array aggregate is larger
  217.  *  than this, is will NOT be optimized.
  218.  *  It is also used in type.c in a way that should be reviewed (ds 7-18-86)
  219.  */
  220. #define MAX_STATIC_SIZE 10000
  221.  
  222. /* define SMALLOC to use smalloc for string allocation */
  223. #define SMALLOC
  224.  
  225. #ifndef EXPORT
  226. #define DEBUG
  227. #define CHAOS    
  228. #define TRACE
  229. /* define IOT to compile trace code for i/o */
  230. #define IOT
  231. #else
  232. #define chaos(v)             exit_internal_error()
  233. #define emalloct(n,s)            emalloc(n)
  234. #define malloct(n,s)            malloc(n)
  235. #define erealloct(ptr, size, msg)    erealloc(ptr, size)
  236. #define efreet(p,msg)            efree(p)
  237. #define ecalloct(n,m,msg)        ecalloc(n,m)
  238. #endif
  239.  
  240. #endif /* _config_h */
  241.